-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support wchar_t in argv in windows #3547
Conversation
Awesome, thank you 👍 I will test soon. |
app/src/main.c
Outdated
int wargc; | ||
wchar_t **wargv = CommandLineToArgvW(GetCommandLineW(), &wargc); | ||
|
||
if (argc != wargc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible? Shouldn't it be an assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view, it is not possible. However, it doesn't indicate it in the official document.
PR #3547 <#3547> Fixes #2932 <#2932> Signed-off-by: Yu-Chen Lin <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
I think this is not correct to modify I added error handling, and to keep things "separate", I moved the code to a main "wrapper". That way, the "main" Here is a branch: Please review and test if that still works (currently, I could not test on Windows). |
PR Genymobile#3547 <Genymobile#3547> Fixes Genymobile#2932 <Genymobile#2932> Signed-off-by: Yu-Chen Lin <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
a18318e
to
b1dddc8
Compare
I tested and it worked well. However, I found that the elements in array for (int i = 0; i < wargc; ++i) {
free(argv_utf8[i]);
} Also in the windows
Additionally, I saw that you changed |
PR #3547 <#3547> Fixes #2932 <#2932> Signed-off-by: Yu-Chen Lin <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
PR #3547 <#3547> Fixes #2932 <#2932> Signed-off-by: Yu-Chen Lin <[email protected]> Signed-off-by: Romain Vimont <[email protected]>
Good catch 👍
OK, I added: (void) argc;
(void) argv; (yes, also Here is a branch:
Yes, |
LGTM in pr3547.2 branch. |
👍 merged into |
This MR will fix #2932.
There are various approaches that can be used to address this issue, such as the usage of
wmain
with link flag-municode
. Only the applied method, however, was successful.Signed-off-by: Yu-Chen Lin [email protected]